package cn.edu.scau.cmi.chenyaoquan.adapter;

import java.util.ArrayList;
import java.util.List;

public class AdapterOfClass extends SortUtil implements Target {
	List<Integer> intList = new ArrayList<Integer>();

	public void stuSort(List<Student> stuList) {
		for (int i = 0; i < stuList.size(); i++) {
			intList.add(stuList.get(i).getNumber());
		}
		
		 sortInt(intList);
		 
		for (int i = 0; i < intList.size(); i++) {
			for (int j = 0; j < stuList.size(); j++) {
				if (intList.get(i) == stuList.get(j).getNumber()) {
					Student stu = stuList.get(i);
					stuList.set(i, stuList.get(j));
					stuList.set(j, stu);
				}
			}
		}
	}
	
}
